<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "d_try.hotsales_recommend".
 *
 * @property string $hotsales_recommend_id
 * @property integer $goods_id
 * @property string $goods_name
 * @property integer $display
 * @property integer $sort
 * @property string $recommend_starttime
 * @property string $recommend_endtime
 * @property string $add_time
 */
class HotsalesRecommend extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'd_try.hotsales_recommend';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['goods_id', 'goods_name', 'sort', 'recommend_starttime', 'recommend_endtime'], 'required'],
            [['goods_id', 'display', 'sort'], 'integer'],
            [['recommend_starttime', 'recommend_endtime','add_time'], 'safe'],
            [['goods_name'], 'string', 'max' => 50],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'hotsales_recommend_id' => 'Hotsales Recommend ID',
            'goods_id' => '商品ID',
            'goods_name' => '商品名称',
            'display' => '是否显示',
            'sort' => '排序',
            'recommend_starttime' => '推荐起始时间',
            'recommend_endtime' => '推荐截至时间',
            'add_time' => '添加时间',
        ];
    }

    /**
     * @inheritdoc
     * @return \services\models\HotsalesRecommendQuery the active query used by this AR class.
     */
    public static function find()
    {
        return new \services\models\HotsalesRecommendQuery(get_called_class());
    }
}
